<!-- orderDetail 页面内容 -->
<section class="orderDetail container" ng-controller="orderDetailCtrl">
    <input type="file" name="images" style='display: none;' id='speedimg0'>
    <input type="file" name="images" style='display: none;' id='speedimg1'>
    <input type="file" name="images" style='display: none;' id='speedimg2'>
    <input type="file" name="images" style='display: none;' id='speedimg3'>
    <input type="file" name="images" style='display: none;' id='speedimg4'>
    <input type="file" name="images" style='display: none;' id='speedimg5'>
    <input type="file" name="images" style='display: none;' id='speedimg10'>
    <input type="file" name="images" style='display: none;' id='speedimg11'>
    <input type="file" name="images" style='display: none;' id='speedimg12'>
    <input type="file" name="images" style='display: none;' id='speedimg13'>
    <input type="file" name="images" style='display: none;' id='speedimg14'>
    <input type="file" name="images" style='display: none;' id='speedimg15'>
    <input type="file" name="images" style='display: none;' id='speedimg16'>
    <input type="file" name="images" style='display: none;' id='speedimg17'>
    <input type="file" name="images" style='display: none;' id='speedimg18'>
    <!-- 面包屑导航 -->
    <div class="row margin-reset breadcrumb-row">
        <ol class="breadcrumb padding-reset">
            <li ng-click="goBack();"><a>我的订单</a></li>
            <li class="li-1"><a>订单详情</a></li>
            <li class="li-2"><a ng-click="goBack();">返回上一页</a></li>
        </ol>
    </div>
    <div class="row margin-reset content-row">
        <!-- 状态栏-竖栏 -->
        <div class="col-lg-1 col-md-1 col-sm-1 padding-reset hidden-xs">
            <ul class="list-group yf-shadow state-list-group">
                <li class="list-group-item disabled">订单进度</li>
                <li class="list-group-item" ng-repeat="(key, arr) in statesArrs track by key" ng-class="{'active': arrindex >= key}">
                    <div class="cricle">
                    </div>
                    <span>{{ arr.name }}</span>
                </li>
            </ul>
        </div>
        <div class="col-lg-11 col-md-11 col-sm-11 col-xs-12">
            <!-- 最新进展 -->
            <div class="row margin-reset new-step-row">
                <div class="panel yf-shadow">
                    <div class="panel-heading">
                        <h4>最新进展</h4>
                    </div>
                    <div class="panel-body">
                        <!-- 新订单的样式 -->
                        <div class="row margin-reset" ng-show="order.workflow_state == 'new'">
                            <div class="col-sm-1 col-xs-1">
                                <img class="img-circle" ng-src="{{ user.headimg.url }}?imageView2/1/w/200/h/200/interlace/1" onerror="this.src='components/mine/imgs/image.jpg'">
                            </div>
                            <div class="col-sm-11 col-xs-11">
                                <p>您生成了一个新订单，请耐心等待服务商接单！</p>
                                <p class="tip-info">{{ order.updated_at * 1000 | date: 'yyyy-MM-dd HH:mm'}}</p>
                            </div>
                            <div class="col-sm-12 col-xs-12">
                                <div class="pull-right cancel-block">
                                    您可以
                                    <a class="edit-btn" data-toggle="modal" data-target="#myModal" ng-if='user.id == order.customer_id'>编辑</a>
                                    <a class="cancel-btn" ng-click="deleteOrder(order.id);">取消订单</a>
                                </div>
                            </div>
                        </div>
                        <!-- 订单已被接受的样式 -->
                        <div class="row margin-reset" ng-show="order.workflow_state == 'appointed_measurement'">
                            <div ng-if="user_role != 2 || ( user.id == order.customer_service_id && user.id != order.facilitator_id )">
                                <div class="col-sm-1 col-xs-1">
                                    <img class="img-circle" ng-src="{{ order.customer_service_info.image }}?imageView2/1/w/200/h/200/interlace/1" onerror="this.src='components/mine/imgs/image.jpg'">
                                </div>
                                <div class="col-sm-11 col-xs-11">
                                    <div>
                                        <span class="name" ui-sref="merchant({ id: order.facilitator_id })" style="cursor: pointer;">
                                            {{order.customer_service_info.name}}
                                        </span> 接了订单，请耐心等待。
                                    </div>
                                    <div class="tip-info">{{ order.updated_at * 1000 | date: 'yyyy-MM-dd HH:mm'}}</div>
                                </div>
                            </div>
                        </div>
                        <!-- 订单以测量 -->
                        <div class="row margin-reset" ng-show="order.workflow_state == 'measured'">
                            <div class="col-sm-1 col-xs-1">
                                <img class="img-circle" ng-src="{{ order.customer_service_info.image }}?imageView2/1/w/200/h/200/interlace/1" onerror="this.src='components/mine/imgs/image.jpg'">
                            </div>
                            <div class="col-sm-12 col-xs-12 tip-info">
                                <div>
                                    <span class="name" ui-sref='merchant({ id: order.facilitator_id })'>{{ order.service_info.name }}</span> 上传了{{ order.measure_pictures[0].length }}张测量文件，等待审核
                                </div>
                                <div>{{ order.updated_at * 1000 | date: 'yyyy-MM-dd HH:mm'}}</div>
                                <div preview-picture datas='order.measure_pictures[0]'></div>

                                <!-- <ul class='previewpicturelist'>
                                    <li ng-repeat='(kp, pic) in order.measure_pictures[0] | orderBy: pic.brand_id track by kp'>
                                        <img ng-src="{{ pic.image.url | to_url }}" data-action="zoom">
                                    </li>
                                </ul> -->
                            </div>
                        </div>
                        <!-- 上传测量信息的样式 -->
                        <div class="row margin-reset" ng-show="user_role == 2 && ['appointed_measurement', 'measured'].indexOf(order.workflow_state) != -1">
                            <div class="col-sm-1 col-xs-1" ng-if='order.measure_pictures.length == 0'>
                                <img class="img-circle" ng-src="{{ order.customer_service_info.image }}?imageView2/1/w/200/h/200/interlace/1" onerror="this.src='components/mine/imgs/image.jpg'">
                            </div>
                            <div class="col-sm-12 col-xs-12" ng-class="{'col-sm-12 col-xs-12': order.measure_pictures.length > 0}">
                                <p class="tip-info" ng-if='order.measure_pictures.length == 0'>
                                    <span class="name" ui-sref="merchant({ id: order.facilitator_id })" style="cursor: pointer;">
                                      {{order.customer_service_info.name}}
                                  </span> 已上门测量，上传文件
                                </p>
                                <p class="tip-info">测量文件最多可上传9张，小于10M。<span ng-if="order.measure_pictures.length > 0">如图纸有误，可再次上传。</span></p>
                                <!-- <ul id="previewul"></ul> -->
                                <!-- <div muti-upload-images muti-count="6" auth-token="nowToken"></div> -->
                                <!-- <div update-images type="'measure_pictures'" updateState></div> -->
                                <div class="row margin-reset uploadImagePanel" ng-repeat="(key, uploadData) in uploadDatas track by key">
                                    <div class="panel">
                                        <div class="panel-body">
                                            <div class="row margin-reset">
                                                <div class="col-sm-2 col-xs-6" style="height: 45px;">
                                                    <select style="height: 30px;" class="styled-select form-control" id='de-company_id' name='company_id' ng-model='uploadData.brand_id' ng-options="fetch.id as fetch.name for fetch in fetchs.company" required>
                                                        <option value="" selected>请选择品牌</option>
                                                    </select>
                                                </div>
                                                <div class="col-sm-3 col-xs-6 more" style="height: 45px;line-height: 35px;">
                                                  	<a ng-if="uploadDatas.length < fetchs.company.length && key == 0" ng-click="addUploadDatas();">添加更多</a>
                                                  	<a ng-if="uploadDatas.length > 0 && key != 0" ng-click="deleteUploadDatas($index);">删除</a>
                                                </div>
                                                <div class="col-sm-7 col-xs-12 uploadImage uploadImageBtn{{uploadData.brand_id}}">
                                                    <input class="uploadFileInput" type="file" name="{{group.id}}" id="{{group.id}}" style="display: none;" ng-repeat="(idx, group) in uploadData.data_group track by idx">
                                                    <img class="{{group.id}}" data-id="{{group.id}}" src="./components/mine/orders/imgs/addpic.png" ng-repeat="(idx, group) in uploadData.data_group track by idx">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-12 col-xs-12">
                                <div class="pull-left">
                                    <button class="btn btn-mt-ok" ng-click="uploadFileNew('image', 'measure_pictures', 'speedimg');">
                                      <span class="glyphicon glyphicon-ok"></span>完成
                                    </button>
                                </div>
                                <div class="pull-right cancel-block need-padding">
                                    <a class="cancel-btn" ng-click="deleteOrder(order.id);">取消订单</a>
                                </div>
                            </div>
                        </div>
                        <!-- 用户和服务商在品牌商内容显示的状态 -->
                        <div class="row margin-reset" ng-show="order.workflow_state == 'appointed_installation'">
                            <div class="col-sm-2 col-xs-12 need-padding">
                                <img class="img-fang" ng-src="{{order.company_logo}}?imageView2/1/w/200/h/200/interlace/1" ng-if="order.company_logo" onerror="this.src='components/mine/imgs/image.jpg'" style="height: 55px;width: 55px;">
                            </div>
                            <div class="col-sm-10 col-xs-12">
                                <div>品牌商审核通过，等待安装</div>
                                <div ng-if="user.id != order.facilitator_id && order.facilitator_id!=null">
                                    订单指派给了 <span class="name" ui-sref='merchant({ id: order.facilitator_id })'>{{ order.service_info.name }}</span>
                                </div>
                                <div ng-if="(user_role == 2 && setisinstalltime==true && order.completed_pictures.length <= 0 && user.id==order.customer_service_id && pig==null)">
                                    <div> 预约安装时间</div>
                                    <div class="row margin-reset need-padding">
                                        <div class="line c1 need-padding" ng-show="order.install_date">
                                            {{ order.install_date * 1000 | date: 'yyyy/MM/dd HH:mm' }}
                                        </div>
                                        <div class="col-sm-3 col-xs-12 padding-reset ">
                                            <input class="flatpickr form-control mt_input" id='flatpickrc' set-time time='order.install_date' type="text" placeholder="请选择预约安装时间">
                                        </div>
                                    </div>
                                    <div  class="row margin-reset need-padding " >
                                        <div class="line time row margin-reset">安装师傅:</div>
                                        <div class="col-sm-3 col-xs-12 line margin-reset need-padding" style="padding-left: 0px;">
                                            <input type="text" class='form-control mt_input' ng-value="order.service_info.name"  data-toggle="modal" data-target="#servermodal" name="">
                                        </div>
                                         <div class="line row margin-reset need-padding ">
                                            <a class='btn yf-btn' data-toggle="modal" data-target="#servermodal">选择安装师傅</a>
                                         </div> 
                                    </div>
                                    <div class="line">
                                        <a ng-click="updateTimeAndMaster(false, order, user.id == order.customer_id);" class="btn btn-mt-ok">
                                            确定
                                        </a>
                                    </div>
                                </div>
                                <div ng-if="user_role == 1 && setisinstalltime==true && user.id != order.facilitator_id && order.completed_pictures.length <= 0">
                                    <div> 预约安装时间</div>
                                    <div class="row margin-reset need-padding">
                                        <div class="line c1 need-padding" ng-show="order.install_date">
                                            {{ order.install_date * 1000 | date: 'yyyy/MM/dd HH:mm' }}
                                        </div>
                                        <div class="col-sm-3 col-xs-12 padding-reset ">
                                            <input class="flatpickr form-control mt_input" id='flatpickrc' set-time time='order.install_date' type="text" placeholder="请选择预约安装时间">
                                        </div>
                                    </div>
                                    <div  class="row margin-reset need-padding " >
                                        <div class="line time row margin-reset">安装师傅:</div>
                                        <div class="col-sm-3 col-xs-12 line margin-reset need-padding" style="padding-left: 0px;">
                                            <input type="text" class='form-control mt_input' ng-value="order.service_info.name"  data-toggle="modal" data-target="#servermodal" name="">
                                        </div>
                                         <div class="line row margin-reset need-padding ">
                                            <a class='btn yf-btn' data-toggle="modal" data-target="#servermodal">选择安装师傅</a>
                                         </div> 
                                    </div>
                                    <div class="line">
                                        <a ng-click="updateTimeAndMaster(false, order, user.id == order.customer_id);" class="btn btn-mt-ok">
                                            确定
                                        </a>
                                    </div>
                                </div>
                                <div ng-if="order.completed_pictures.length <= 0 && user_role == 2 && user.id==order.facilitator_id" style="margin-top: 10px;">
                                		<div class="line">
                                        上传安装效果图:
                                    </div>
                                    <div class="line">
                                        <ul id="previewul1"></ul>
                                    </div>
                                    <br>
                                    <br>
                                    <br>
                                    <br>
                                    <p>
                                        <button type='button' class="btn btn-mt-ok" ng-click="completed('image_type', 'completed_pictures', 'speedimg1');">
                                            <span class="glyphicon glyphicon-ok"></span> 完成
                                        </button>
                                    </p>
                                </div>
                                
                              
                                
                                <!--{{user_role}},{{user.id}},{{order.facilitator_id}},{{order.customer_id}}-->
                                
                                <!--<div ng-if="user_role != 0 && ">-->
                                	<!--（user_role != 1 && user.id == order.facilitator_id ）|| user.id == order.customer_id-->
                                		
                                    <!-- <div class="tip-info need-padding">{{ order.updated_at * 1000 | date: 'yyyy-MM-dd HH:mm'}}</div> -->
                                    <!-- 发单人可以指派师傅 -->
                                    <!-- <div ng-if='user.id == order.customer_id'>
                                        <div class="line">
                                            <input type="text" class='form-control' ng-value="order.service_info.name" data-toggle="modal" data-target=".servermodal" name="">
                                        </div>
                                        <div class="line">
                                            <a ng-click="updateTimeAndMaster(false, order, user.id == order.customer_id);" class="btn btn-default btn-upload">
                                              确定
                                            </a>
                                        </div>
                                    </div> -->
                                    <!-- 师傅选择安装时间    用户修改时间 -->
                                    <!--(user_role == 2 && !order.install_date)|| (user.id == order.customer_id && user_role != 2)-->
                                    <!--<div ng-show="(user_role == 2 && !order.install_date)">
                                        <div>
                                            预约安装时间
                                        </div>
                                        <div class="row margin-reset need-padding">
                                            <div class="line c1 need-padding" ng-show="order.install_date">
                                                {{ order.install_date * 1000 | date: 'yyyy/MM/dd HH:mm' }}
                                            </div>
                                            <div class="col-sm-3 col-xs-12 padding-reset ">
                                                <input class="flatpickr form-control mt_input" id='flatpickrc' set-time time='order.install_date' type="text" placeholder="请选择预约安装时间">
                                            </div>
                                        </div>-->
                                        <!-- <div class="" ng-if='user_role != 2'>
                                            <a ng-click="installTime();" class="btn btn-mt-ok">
                                                确定
                                            </a>
                                        </div> -->
                                        <!--|| user.id == order.customer_id-->
                                        <!--<div ng-show="user_role == 2">-->
                                        	<!--ng-if='user.id == order.customer_id'-->
                                            <!--<div  class="row margin-reset need-padding " >
                                                <div class="line time row margin-reset">安装师傅:</div>
                                                <div class="col-sm-3 col-xs-12 line margin-reset need-padding" style="padding-left: 0px;">
                                                    <input type="text" class='form-control mt_input' ng-value="order.service_info.name"  data-toggle="modal" data-target="#servermodal" name="">
                                                </div>
                                                 <div class="line row margin-reset need-padding ">
                                                    <a class='btn yf-btn' data-toggle="modal" data-target="#servermodal">选择安装师傅</a>
                                                 </div> 
                                            </div>

                                            <div class="line">
                                                <a ng-click="updateTimeAndMaster(false, order, user.id == order.customer_id);" class="btn btn-mt-ok">
                                                    确定
                                                </a>
                                            </div>
                                        </div>
                                    </div>-->
                                    <!-- 服务商选择安装时间，安装完成后上传效果图 -->
                                    <!--<div ng-if="order.install_date">-->
                                        <!-- <div>
                                            <div class="line time">
                                                预约安装时间
                                            </div>
                                            <div class="line c1 need-padding">
                                                {{ order.install_date * 1000 | date: 'yyyy/MM/dd HH:mm' }}
                                            </div>
                                            <div class="line" ng-if="user_role == 0 && order.completed_pictures.length <= 0">
                                                <a ng-click="changeTime();" class="btn btn-mt-ok">
                                                    修改安装时间
                                                </a>
                                            </div>
                                        </div> -->
                                        <!--order.install_date-->
                                        <!--<div ng-if='order.completed_pictures.length <= 0 && user_role == 2 && setisinstalltime==true'>
                                            <div class="line">
                                                上传安装效果图:
                                            </div>
                                            <div class="line">
                                                <ul id="previewul1"></ul>
                                            </div>
                                            <br>
                                            <br>
                                            <br>
                                            <br>
                                            <p>
                                                <button type='button' class="btn btn-mt-ok" ng-click="completed('image_type', 'completed_pictures', 'speedimg1');">
                                                    <span class="glyphicon glyphicon-ok"></span> 完成
                                                </button>
                                            </p>
                                        </div>-->
                                    <!--</div>-->
                            </div>
                        </div>
                        <!-- 已安装  确认安装 -->
                        <div class="row margin-reset" ng-show="['installed', 'confirm_installed'].indexOf(order.workflow_state) != -1">
                            <div class="col-sm-1 col-xs-1">
                                <img class="img-circle" ng-src="{{ order.service_info.image }}" data-action="zoom" alt="" onerror="this.src='components/mine/imgs/image.jpg'">
                            </div>
                            <div class="col-sm-11 col-xs-11">
                                <!-- 用户支付和服务商自己发单自己支付 -->
                                <div ng-if="user_role != 2 || user.id == order.customer_id">
                                    <div class="need-padding">
                                        <span class="name" ui-sref='merchant({ id: order.facilitator_id })'>{{ order.service_info.name }}</span> 已安装完成
                                    </div>
                                    <div class="tip-info need-padding">{{ order.updated_at * 1000 | date: 'yyyy-MM-dd HH:mm'}}</div>
                                    <!--<div class="line" ng-if="order.customer_id == user.id && order.workflow_state == 'installed' && user.company_id && !order.is_comment && !order.measure_comment">
                                        <a class='btn btn-mt-ok' ng-click="installed();">确认安装</a>
                                    </div>-->
                                    <div class="line" ng-show="!user.company_id || user.company_id && order.workflow_state == 'confirm_installed' ">
                                        <!-- 需求更改，先评价后支付，评价得分跟钱相关 -->
                                        <!-- <a class='btn btn-mt-ok' data-toggle="modal" data-target="#payModal" ng-if="!order.is_company">确认支付</a> -->

                                        <div class='row' ng-if="user.id == order.customer_id">
                                            <!--<div class="tip-info need-padding" style="padding-left: 15px;" ng-if='!order.is_comment || !order.measure_comment'>请对此次服务做出评价!</div>
                                            <div class="col-xs-12 col-sm-6" ng-show="!order.is_comment">
                                                <div class="need-padding">
                                                    测量师傅：{{order.customer_service_info.name}}
                                                </div>
                                                <div class="need-padding">
                                                    评分：<i class="icon-xing" style="cursor: pointer;" ng-class="{'active': (comment[0].raty - 1) >= $index}" ng-mouseover="setRaty($index + 1, order.workflow_state, 0);" ng-click="setRaty($index + 1, order.workflow_state, 0);" ng-repeat="arr in arrs track by $index"></i>
                                                </div>
                                                <div class="need-padding col-sm-6 col-xs-12 padding-reset" ng-if="order.workflow_state != 'completed'">
                                                    评价：
                                                    <textarea class="form-control" style="text-align: left;" ng-model='comment[0].content' ng-disabled="order.is_comment" placeholder="{{comment[1].content}}" ng-readonly="order.workflow_state == 'completed'"></textarea>
                                                </div>
                                                <div class="need-padding" ng-if="order.workflow_state == 'completed'">
                                                    {{ order.comment.content }}
                                                </div>
                                            </div>
                                            <div class="col-xs-12 col-sm-6" ng-show="!order.measure_comment">
                                                <div class="need-padding">
                                                    安装师傅：{{order.service_info.name}}
                                                </div>
                                                <div class="need-padding">
                                                    评分：<i class="icon-xing" style="cursor: pointer;" ng-class="{'active': (comment[1].raty - 1) >= $index}" ng-mouseover="setRaty($index + 1, order.workflow_state, 1);" ng-click="setRaty($index + 1, order.workflow_state, 0);" ng-repeat="arr in arrs track by $index"></i>
                                                </div>
                                                <div class="need-padding col-sm-6 col-xs-12 padding-reset" ng-if="order.workflow_state != 'completed'">
                                                    评价：
                                                    <textarea class="form-control" style="text-align: left;" ng-model='comment[1].content' ng-disabled="order.is_comment" placeholder="{{comment[1].content}}" ng-readonly="order.workflow_state == 'completed'"></textarea>
                                                </div>
                                                <div class="need-padding" ng-if="order.workflow_state == 'completed'">
                                                    {{ order.comment.content }}
                                                </div>
                                            </div>
                                            <div class="line col-sm-12 col-xs-12 padding-reset" style='padding-bottom: 15px;padding-left: 15px;' ng-show='!order.is_comment || !order.measure_comment'>
                                                <a class="btn btn-mt-ok" ng-click="commentOrder(comment);">评论</a>
                                            </div>-->
                                            <!--<div class="line col-sm-12 col-xs-12 padding-reset" style='padding-bottom: 15px;padding-left: 15px;'>
                                                <a class='btn btn-mt-ok' data-toggle="modal" data-target="#payModal" ng-if="order.is_comment && order.measure_comment && !user.company_id">确认支付</a>
                                            </div>-->
                                            <div class="line col-sm-12 col-xs-12 padding-reset" style='padding-bottom: 15px;padding-left: 15px;'>
                                                <a class='btn btn-mt-ok' data-toggle="modal" data-target="#payModal" ng-if="!user.company_id">确认支付</a>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!-- 测量师傅和安装师傅接的别人的单子     -->
                                <div ng-if='user_role == 2 && (user.id != order.customer_id || (user.id == order.customer_service_id && user.id != order.facilitator_id))'>
                                    <div class="line">
                                        <!-- 测量师傅时显示 -->
                                        <span ng-if='user.id == order.customer_service_id && user.id != order.facilitator_id' class="c1">
                                            {{order.service_info.name}}师傅
                                             <!--在服务商安装完成后，只显示“安装完成”，然后客服中心回访后（也就是客户确认安装完成了）-->
                                        </span> 安装完成 <span  ng-if="order.workflow_state=='confirm_installed'">,等待付款</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!-- 完成安装 -->
                        <div class="row margin-reset" ng-show="order.workflow_state == 'completed'">
                            <div class="col-sm-12 col-xs-12">
                                <!--  <img class="img-circle" ng-src="{{ order.customer_service_info.image }}?imageView2/1/w/200/h/200/interlace/1">
                                <span class="name">{{order.customer_service_info.name}}</span>已安装完成。 -->
                                <div class="" ng-if='user.id != order.customer_id'>
                                    订单已经完成
                                </div>
                                <div class="tip-info need-padding" ng-if="user.id != order.customer_id">{{ order.updated_at * 1000 | date: 'yyyy-MM-dd HH:mm'}}</div>
                                <div ng-if="user.id == order.customer_id">
                                    <div class="">您已付款成功!订单完成!</div>
                                    <div class="tip-info need-padding">{{ order.updated_at * 1000 | date: 'yyyy-MM-dd HH:mm'}}</div>
                                    <!-- <div class="tip-info need-padding">您可以在我的钱包中查看收金额</div> -->
                                    <div class="" ng-if="user.id != order.facilitator_id && user.id == order.customer_service_id">订单实际总收入：￥{{ order.measure_amount_after_comment | moneyint:true }}</div>
                                    <div class="" ng-if="user.id == order.facilitator_id && user.id != order.customer_service_id">订单实际总收入：￥{{ order.installed_amount_after_comment | moneyint:true }}</div>
                                    <div class="" ng-if="user.id == order.facilitator_id && user.id == order.customer_service_id">订单实际总收入：￥{{ order.terminal_count | moneyint:true }}</div>

                                    <!-- <div class="need-padding">
                                        评分：<i class="icon-xing" ng-class="{'active': (comment.raty - 1) >= $index}" ng-mouseover="setRaty($index + 1, order.state);" ng-click="setRaty($index + 1, order.state);" ng-repeat="arr in arrs track by $index"></i>
                                    </div>
                                    <div class="need-padding col-sm-3 col-xs-12 padding-reset" ng-if="order.state != 'completed'">
                                        评价：
                                        <textarea class="form-control" style="text-align: left;" ng-model='comment.content' ng-disabled="order.is_comment" placeholder="{{comment.content}}" ng-readonly="order.state == 'completed'"></textarea>
                                    </div>
                                    <div class="need-padding" ng-if="order.state == 'completed'">
                                        {{ order.comment.content }}
                                    </div>
                                    <div class="line col-sm-12 col-xs-12 padding-reset" style='padding-bottom: 15px;' ng-show='!order.is_comment'>
                                        <a class="btn btn-mt-ok" ng-click="commentOrder(comment);">评论</a>
                                    </div> -->
                                </div>
                                <div ng-if='user_role == 2 && user.id != order.customer_id'>
                                    <div class="">
                                        客户已支付订单，您可以在我的钱包中查收金额！
                                    </div>
                                    <div class="tip-info need-padding">
                                        注：已扣除
                                        <span class='c1'>评价费用</span>-
                                        <span ng-if="user.id != order.facilitator_id && user.id == order.customer_service_id">
                                            ￥{{ order.deduct_measure_cost | moneyint:true }}
                                            劳务费￥{{ order.service_measure_amount | moneyint:true }}
                                            </span>
                                        <span ng-if="user.id == order.facilitator_id && user.id != order.customer_service_id">
                                            ￥{{ order.deduct_installed_cost | moneyint:true }}
                                            劳务费￥{{ order.service_installed_amount | moneyint:true }}
                                        </span>
                                        <span ng-if="user.id == order.facilitator_id && user.id == order.customer_service_id">
                                            ￥{{ (order.deduct_installed_cost + order.deduct_measure_cost) | moneyint:true }}
                                            劳务费￥{{ (order.service_measure_amount + order.service_installed_amount) | moneyint:true }}
                                        </span>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!-- 订单已经取消 -->
                        <div class="row margin-reset" ng-if="order.workflow_state == 'canceled'">
                            <div class="col-sm-12 col-xs-12">
                                <p>{{ order.updated_at * 1000 | date: 'yyyy-MM-dd HH:mm'}}</p>
                                订单已经取消
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 订单详情 -->
            <div class="row margin-reset order-detail-row">
                <div class="panel yf-shadow">
                    <div class="panel-heading">
                        <h4>订单详情</h4>
                    </div>
                    <!--<div class="panel-body"  style="padding: 0px 0px;">-->
                        <div class="row margin-reset">
                            <div class="col-sm-6 col-xs-12">
                                <p>订单号：{{order.serial_number}}</p>
                                <p>姓名：{{ order.name }}</p>
                                <p>预估面积:{{order.square}}(㎡) / 品牌:{{order.company_name}}／材质:{{order.material}}</p>
                                <p>
                                    地址：<span class="glyphicon glyphicon-map-marker"></span> {{ order.address }}
                                </p>
                                <p ng-if='!!order.remark'>备注：{{order.remark}}</p>
                                <p>销售提成：{{order.sale_commission/100 || 0}}元</p>
                            </div>
                            <div class="col-sm-6 col-xs-12">
                                <p ng-if='!order.mount_order'>预约测量时间：{{ order.booking_date * 1000 | date: 'yyyy-MM-dd HH:mm '}}</p>
                                <p ng-if='order.mount_order'>预约安装时间：{{ order.install_date * 1000 | date: 'yyyy-MM-dd HH:mm '}}</p>
                                <p>预估总价：{{ order.total_count | moneyint:true }}元</span></p>
                                <!-- <p>价格明细：测量{{ order.measure_amount }}元 / 安装{{ order.total }}元</p> -->
                                <p>价格明细：测量{{ order.measure_amount | moneyint }}元 / 安装{{ (order.total * 100 - order.ship_price) | moneyint:true }}元 / 物流费{{ order.ship_price | moneyint:true }}元</p>
                                <!--<p>-->
                                	 	测量：<span ng-bind="order.customer_service_id ? order.customer_service_info.name : '暂无测量师傅'"></span> / 安装：<span ng-bind="order.facilitator_id ? order.service_info.name : '暂无安装师傅'"></span>
                                    <div class="pull-right edit-block" ng-if="order.state == 'xml'">
                                      <a style="margin-left: 5px;" ui-sref="productInfo({ id: order.id})">查看门窗信息</a>
                                    </div>
                                <!--</p>-->
                                		<div class="pull-right edit-block" ng-if='user_role == 2 && ["measured"].indexOf(order.workflow_state) != -1 && user.id != order.customer_id'>
                                        您可以<a class="edit-btn" ng-click="changeOrder(order);">修改</a>
                                    </div>
                            </div>
                        </div>
                    <!--</div>-->
                </div>
            </div>

            <!-- 订单日志 -->
            <div class="row margin-reset record-row">
                <div journal order='order'></div>
            </div>
        </div>
    </div>
    <div class="modal fade common-modal" id='myModal' tabindex="-1" role="dialog" aria-labelledby="common-modal" aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content yf-shadow">
                <div class="modal-header text-center">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h3 class="modal-title" id="common-modal">
                        编辑订单
                    </h3>
                </div>
                <div class="modal-body">
                    <form name='modalorderform1' role="form" novalidate autocomplete="false" ng-submit="putOrderDetail(modalorderform1.$invalid, editOrder);">
                        <div class="row">
                            <div class=" col-xs-offset-1 col-xs-10">
                                <div class="form-group">
                                    <label for="time">预约时间</label>
                                    <input class="changeflatpickr form-control mt_input" id='changeflatpickr' set-time time='editOrder.booking_date' type="text" placeholder="预约时间" required>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class=" col-xs-offset-1 col-xs-10">
                                <div class="form-group">
                                    <label for="person">预约人</label>
                                    <input type="text" class="form-control mt_input" ng-model='editOrder.name' ng-pattern="/^[A-Za-z0-9\u4e00-\u9fa5]{2,20}$/" name="person" placeholder="预约人" required>
                                </div>
                                <div class="form-group error-container" ng-show="ismodalorderform1 && (modalorderform1.person.$error.pattern || modalorderform1.person.$error.required)">
                                    请输入长度 2-20位的名字(中文，字母，数字组成)！
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class=" col-xs-offset-1 col-xs-10">
                                <div class="form-group">
                                    <label for="tel">联系电话</label>
                                    <input type="tel" class="form-control mt_input" ng-model='editOrder.tel' ng-pattern="/^1[34578]\d{9}$/" name="tel" placeholder="联系电话" required>
                                </div>
                                <div class="form-group error-container" ng-show="ismodalorderform1 && (modalorderform1.tel.$error.pattern || modalorderform1.tel.$error.required)">
                                    请输入有效手机号！
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class=" col-xs-offset-1 col-xs-10 text-center">
                                <button type="submit" class="btn mt_group_btn btn-block">保存修改</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <!-- 确认支付modal -->
    <div class="modal fade common-modal pay_modal" id='payModal' tabindex="-1" role="dialog" aria-labelledby="common-modal">
        <div class="modal-dialog" role="document">
            <div class="modal-content yf-shadow">
                <div class="modal-header text-center">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h3 class="modal-title" id="common-modal">
                        确认支付
                    </h3>
                </div>
                <div class="modal-body">
                    <form name='payorderform' role="form">
                        <div class="form-group form-group-line">
                            <div class="row margin-reset">
                                <div class="col-xs-offset-1 col-xs-7 padding-reset text-left">
                                    测量师傅：{{order.customer_service_info.name}}<br>
                                    安装师傅：{{order.service_info.name}}
                                </div>
                                <div class="col-xs-3 text-right state">总计</div>
                            </div>
                            <div class="row margin-reset">
                                <div class="col-xs-offset-1 col-xs-7 padding-reset text-left text-muted">
                                    价格明细：测量费用￥{{(order.measure_amount_after_comment + order.service_measure_amount) | moneyint:true}}<br>
                                    安装费用￥{{( order.installed_amount_after_comment + order.service_installed_amount - order.ship_price ) | moneyint:true}}<br>
                                    平台服务费{{order.basic_tax | percent}} ￥{{order.basic_order_tax | moneyint:true}}<br>
                                    物流费 ￥{{ order.ship_price | moneyint:true }}<br>
                                </div>
                                <div class="col-xs-3 padding-reset text-right"><span class="money1">￥{{ order.amount_total_count | moneyint:true }}</span></div>
                            </div>
                        </div>
                        <div class="form-group form-group-line">
                            <div class="row margin-reset">
                                <div class="col-xs-offset-1 col-xs-6 padding-reset text-left">账户余额</div>
                                <div class="col-xs-4 padding-reset text-right"><span class="money2">￥{{ user.amount | moneyint: true }}</span></div>
                            </div>
                        </div>
                        <div class="row">
                            <div class=" col-xs-offset-1 col-xs-10 text-center">
                                <button type="submit" class="btn mt_group_btn btn-block" ng-disabled="payorderform.$invalid" ng-click="payOrder(order);">立即付款</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <!-- 指定服务商 -->
    <div class="modal fade common-modal" id="servermodal" tabindex="-1" role="dialog" aria-labelledby="common-modal">
        <div class="modal-dialog" role="document">
            <div class="modal-content yf-shadow">
                <div class="modal-header text-center">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h3 class="modal-title" id="common-modal">
                          指定服务商
                    </h3>
                </div>
                <div class="modal-body">
                    <div class="row">
                        <div class="col-lg-offset-1 col-lg-10 col-md-offset-1 col-md-10 col-sm-offset-1 col-sm-10 col-xs-12">
                          <form role="form" class="search-input-group">
                              <div class="input-group">
                                  <input type="search" class="form-control mt_input" ng-model='keyword' ng-enter="getMaster(keyword);" placeholder="输入师傅的账号或姓名">
                                  <span class="input-group-btn">
                                      <button class="btn mt_group_btn" type="button" ng-click="getMaster(keyword);">搜索</button>
                                  </span>
                              </div>
                          </form>
                        </div>
                        <div class="col-lg-offset-1 col-lg-10 col-md-offset-1 col-md-10 col-sm-offset-1 col-sm-10 col-xs-12" ng-show='noperson' ng-bind='noperson' style="color: red;">
                        </div>
                        <div class="col-lg-offset-1 col-lg-10 col-md-offset-1 col-md-10 col-sm-offset-1 col-sm-10 col-xs-12">
                          <table class="table table-striped table-bordered table-condensed">
                              <thead ng-if="masters">
                                  <th>账号</th>
                                  <th>姓名</th>
                              </thead>
                              <tr ng-repeat="master in masters track by $index">
                                  <td ng-click="setMaster(master);">{{master.tel}}</td>
                                  <td ng-click="setMaster(master);">{{master.real_name}}</td>
                              </tr>
                          </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
